package org.example.cloud.config;

import io.swagger.v3.oas.models.ExternalDocumentation;
import io.swagger.v3.oas.models.OpenAPI;
import io.swagger.v3.oas.models.info.Info;
import org.springdoc.core.models.GroupedOpenApi;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author 宋孟林
 * @description
 * @date: 2025/4/5 8:04
 */
@Configuration
public class SwaggerConfig {
    /**
     * 将接口分组
     * @return 分组对象
     */
    @Bean
    public GroupedOpenApi payApi(){
        return GroupedOpenApi.builder().group("支付微服务模块").pathsToMatch("/pay/**").build();
    }

    @Bean
    public OpenAPI docsOpenApi(){
        return new OpenAPI()
                .info(new Info().title("mscloud24")
                        .description("通用rest设计")
                        .version("v1.0")
                ).externalDocs(new ExternalDocumentation()
                        .description("www.atguigu.com")
                        .url("www.google.com"));
    }
}
